package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class MainController {
    @Autowired
    private IProductService productService;
    @RequestMapping("/")
    public String main(HttpServletRequest req){
        IPage ip = productService.findByItem(1,null);
        req.setAttribute("pg",ip);
        return "/index.html";
    }
}
